package org.serg.match3;

import android.graphics.drawable.Drawable;
import android.widget.ImageView;

/*
 * Model describe cell
 */
public class Jewel {

	private Drawable image;
	private int index;
	private int position;
	private ImageView cell;
	private boolean block;
	
	public Jewel(ImageView cell, Drawable image, int index, int position) {
		this.image=image;
		this.index=index;
		this.position=position;
		this.cell=cell;
		this.block = false;
	}
	
	public void draw() {
		if (this.image == null || this.cell == null) {
			return;
		}
		this.cell.setImageDrawable(this.image);
	}
	/*
	 * 
	 */
	public void block() {
		this.block = true;
	}
	
	public void unblock() {
		this.block = false;
	}
	
	public boolean isblock() {
		return this.block;
	}
	
	/*
	 * 
	 */
	public int getIndex() {
		return index;
	}
	public void setIndex(int inx) {
		this.index = inx;
	}
	/*
	 * 
	 */
	public int getPosition() {
		return position;
	}
	/*
	 * 
	 */
	public ImageView getCell() {
		return cell;
	}
	
	public void setCell(ImageView cl) {
		this.cell = cl;
	}
	
	/*
	 * 
	 */
	public Drawable getImage() {
		return image;
	}
	
	public void sesImage(Drawable img) {
		this.image = img;
	}
}
